package proxy.proxyStatic;

/**
 * @author Lenovo
 */
public class FunctionProxy implements IFunction {
    private IFunction target;

    public FunctionProxy(IFunction target) {
        this.target = target;
    }

    @Override
    public void fun() {
        System.out.println("pre function");
        target.fun();
        System.out.println("after function");
    }

    public static void main(String[] args) {
        Function target = new Function();
        FunctionProxy proxy = new FunctionProxy(target);
        proxy.fun();
    }
}
